package com.weipai.education.mapper;

import com.weipai.education.model.InventoryIn;
import com.weipai.education.model.InventoryInDetail;
import com.weipai.education.model.InventoryOut;
import com.weipai.education.model.PurchaseDetail;
import org.apache.ibatis.annotations.Param;

import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Map;

public interface InventoryOutMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(InventoryOut record);

    int insertSelective(InventoryOut record);

    InventoryOut selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(InventoryOut record);

    int updateByPrimaryKey(InventoryOut record);

    List<Map<String,Object>> inventoryOutList(@Param("start") Integer start, 
                                              @Param("end") Integer size, 
                                              @Param("goodsBarCode") String goodsBarCode, 
                                              @Param("spuNumber") String spuNumber, 
                                              @Param("startTime") String startTime, 
                                              @Param("endTime") String endTime, 
                                              @Param("userId") String userId);

    Integer inventoryOutListAmount(@Param("goodsBarCode") String goodsBarCode, 
                                   @Param("spuNumber") String spuNumber, 
                                   @Param("startTime") String startTime, 
                                   @Param("endTime") String endTime, 
                                   @Param("userId") String userId);

    InventoryInDetail getInventoryOutDetail(@Param("purchaseNumber") String purchaseNumber,
                                            @Param("goodsBarCode") String goodsBarCode);

    InventoryInDetail getInventoryOutDetailByisPrice( String purchaseNumber
                                            );

    int getSaleNumber(@Param("userId") String userId);

    List<Map<String, Object>> getSaleNumberWeek(String userId);

    PurchaseDetail getPurchaseDetail(@NotNull(message = "产品id不能为空") Integer productId);

    InventoryInDetail getInventoryOutDetailByisDamage(String inOrderNumber);
}